<!----------------------------- body ---------------------------------------->

<div id="h_main" class="main_width">
    <?php //echo "<prE>";var_dump($Product);die(); ?>
    <!-- breadcrumb -->
    <?php echo $this->element('breadcrumb',array('breadcrumb' => $breadcrumb)); ?>
    <?php echo $this->Session->flash(); ?>
    <!-- end breadcrumb -->
    <?php if(ID_PRODUCT_TYPE_APT != $Product['product']['product_type']){?>
    <!-- BEGIN PRODUCTS DEFAULT -->
    <div id="product_view" style="padding-top:0px;">
        <div id="title_fearture" style="border:none; margin: 20px 0px 0px 2px;">
            <span><?php echo $Product['product_language']['name'] ?></span>
        </div>
        <span><b><?php echo __('Property ID'); ?></b>: <?php echo $Product['product']['product_id'] ?></span>
        <p></p>
        
        <div id="content_product" >
            <div id="product_ct_left">
            	<div id="gallery" class="ad-gallery boder_radius">
                      <div class="ad-image-wrapper">
                      </div>
                      <div class="ad-controls">
                      </div>
                      <div class="ad-nav">
                        <div class="ad-thumbs">
                          <ul class="ad-thumb-list">
                            <li>
                              <a href="<?php echo $this->webroot.$base_config_url.$Product['product']['image']?>">
                                <img src="<?php echo $this->webroot.$base_config_url.$Product['product']['image']?>" class="image0">
                              </a>
                            </li>
                           <?php foreach($Product['images'] as $image):?>
                            <li>
                              <a href="<?php echo $this->webroot.$base_config_url.$image['ProductImage']['url']?>">
                                <img src="<?php echo $this->webroot.$base_config_url.$image['ProductImage']['url']?>" class="image0">
                              </a>
                            </li>
                            <?php endforeach;?>
                          </ul>
                        </div>
                      </div>
                 </div>
            </div>
            <div id="product_ct_right">
                <table class="table table-bordered table-striped" style="font-size:13px;">
                    <thead>
                      <tr>
                          <th id="table_property_th" colspan="2"><?php echo __('Property Information');?></th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <td style="width:120px;">Price </td>
                        <td><span class="h_price" style="font-size:20px">$<?php  echo $Product['product']['price'] ?><?php echo $unitprice = $Product['product']['unit_price'] == 2 ? ' /m2' : ' /month'; ?></span></td>
                      </tr>
                      <tr>
                          <td><?php echo __('Type of Property'); ?> </td>
                          <td>
                              <?php echo $Product['product_type']['name'];?>
                          </td>
                      </tr>
                      <?php 
                      if(isset($Property_name_apt) && is_array($Property_name_apt))
                      {
                      ?>
                      <tr>
                          <td><?php echo $Property_name_apt['name'];?> </td>
                          <td>
                              <?php echo $Property_name_apt['value'];?>
                          </td>
                      </tr>
                      <?php }
                          
                      ?>
                      <tr>
                        <td>
                          <?php echo __('Location/district'); ?> 
                        </td>
                        <td>
                            <?php echo $Product['location']['city'].' / '.$Product['location']['district']; ?>.
                            
                        </td>
                      </tr>
                      <tr>
                        <td style="width:95px;">
                          <?php echo __('Street'); ?> 
                        </td>
                        <td><?php  echo $Product['product']['address'] ?>.
                      </tr>
						<?php //print_r($Property_list);exit; ?>
                        <?php foreach($Property_list as $val_show): ?>
                                <?php if(!($val_show['property_language']) || !($val_show['property_value_language'])) {continue;}
								if(in_array($val_show['property_id'], Configure::read('Property.value_m2'))){ $val_show['property_value_language'] = $val_show['property_value_language'].'m2';}?>
                                <tr>
                                    <td>
                                      <?php echo  $val_show['property_language']?> 
                                    </td>
                                    <td><?php echo  $val_show['property_value_language']?></td>
                                  </tr>
                        <?php endforeach;?>
                    </tbody>
                  </table>
                
                
                
                </br>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-left:0px;padding-top:15px;padding-bottom:15px;">
                    <tbody style="font-family: 'Chewy', cursive;">
                        <tr>
                            <td width="200" style="padding-right:10px;"> 
                                <a class="h_product_name" href="<?php echo $this->Html->url('/home/contact/'.$Product['product']['product_id']);?>">
                                    <img style="height:80px; width:245px;" src="<?php echo $this->webroot; ?>images/button-check-availability.jpg" border="0" width="100px" height="75px;">
                                </a>
                            </td>
                            <td style="text-align:center;">
				<div class="contactdetail" style="border-bottom: 1px solid;margin-left: 60px;width: 50px;"><?php  echo __('Contact'); ?></div>
                                <div class="contactdetail1" ><?php  echo $Product['product']['contact_email'] ?></div>
				<div class="contactdetail1" ><a"><?php  echo $Product['product']['contact_phone'] ?></a></div>
                                <div class="contactdetail1" ><a><?php  echo $Product['product']['contact_name'] ?></a></div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="clearBoth"></div>
            

            <!--BEGIN TAB --->
                <ul class="nav nav-tabs">
                    <li  class="active"><a href="#home" data-toggle="tab"><?php echo __('Overview')?></a></li>
                    <!--<li><a href="#profile" data-toggle="tab"><?php echo __('Request a showing')?></a></li>-->
                    <li><a href="#messages" data-toggle="tab"><?php echo __('Send to a friend')?></a></li>
                    <li class="show_map"><a href="#settings" data-toggle="tab"><?php echo __('Map view')?></a></li>
                  </ul>

                  <!-- Tab panes -->
                  <div class="tab-content">
                    <div class="tab-pane active" id="home">
                        <h4><?php echo __('Description');?></h4>
                        <div class="description_product">
                            <p>
                                <?php echo $Product['product_language']['description']; ?>
                            </p>
                        </div>
                        <!-- BEGIN for PROPERTY ARR -->
                        
                            <?php
                                    if(isset($Product['multipleSelect'])){
                                    foreach($Product['multipleSelect'] as $property):?>
                                            <div class="property_arr">
                                            <h4><?php echo $property['property_name'];?></h4>
                                            <?php foreach($property['allValue'] as $val):?> 
                                                    <?php $show = $val['is_check'] ? 'icon-ok' : 'icon-remove' ?>
                                                    <?php $show = $val['is_check'] ? 'yes.png' : 'dis.png' ?>
                                                    <div style="width:30%; float:left;">
                                                             <!--<span class="glyphicon <?php echo $show; ?>"></span>-->
                                                             <img src="<?php echo $this->webroot; ?>images/global/<?php echo $show ?>" width="19" height="19">
                                                             <?php echo $val['property_value_name'];?>            
                                                    </div>

                                            <?php endforeach;?>
                                            <div class="ClearBoth"></div>
                                            </div>
                                    <?php endforeach;?>
                                    <?php } ?>
                            
                        <!-- END for PROPERTY ARR -->
                    </div>
                    <!--<div class="tab-pane" id="profile">
                        <br/>
                       <p>We specializes in helping the Vietnam’s foreign community with their long- and short-term real estate rental and purchasing needs, including apartments, houses, villas and commercial office space within Ha Noi proper and the surrounding area.</p>
                       <span><i>(*) Please complete the following information!</i></span>
                        <br/>
                       <form action="">
                       <table class="table_form" style="font-size:12px"  width="80%" border="0" align="center" cellpadding="2" cellspacing="0" bordercolor="#dedede" style="border-collapse: collapse">
                            <tbody>
                                    <tr>
                                            <td>Property name:</td>
                                            <td><b>Lake view, serviced apartment in quiet street Tay Ho Hanoi (ID Code: 714)</b></td>
                                    </tr>
                                    <tr>
                                            <td>Your Name:  (*)</td>
                                            <td><input class="class_320pt" type="text" name="name"/></td>
                                    </tr>
                                    <tr>
                                            <td>Your Email:  (*)</td>
                                            <td><input class="class_320pt" type="text" name="email"/></td>
                                    </tr>
                                    <tr>
                                            <td>Mobile Phone Number:</td>
                                            <td><input class="class_320pt" type="text" name="mobile"/></td>
                                    </tr>
                                    <tr>
                                            <td>Other Phone number:</td>
                                            <td><input class="class_320pt" type="text" name="other_number"/></td>
                                    </tr>
                                    <tr>
                                            <td>Contact Preference:</td>
                                            <td>
                                                <input class="radio_fix" type="radio" name="Preference" value="1"/> Phone
                                                <input class="radio_fix" type="radio" name="Preference" value="2"/> Email
                                                <input class="radio_fix" type="radio" name="Preference" value="3"/> Either
                                            </td>
                                    </tr>
                                    <tr>
                                            <td>Contact Time:</td>
                                            <td>
                                                <input class="radio_fix" type="radio" name="time" value="1"/> Moring
                                                <input class="radio_fix" type="radio" name="time" value="2"/> Afternoon
                                                <input class="radio_fix" type="radio" name="time" value="3"/> Night
                                            </td>
                                    </tr>
                                    <tr>
                                            <td>Special Requests or Comments:</td>
                                            <td><textarea  class="class_320pt" name="txtValue07" rows="6"></textarea></td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td><input  class="radio_fix" type="checkbox" name="check"/> Send a copy of this request to my email
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td><input tabindex="2" type="button" name="Button" class="button" value="  Send Request  "></td>
                                    </tr>

                            </tbody>
                    </table>
                    </form>
                    </div>
                    -->
                    <div class="tab-pane" id="messages">
                        <br/>
                       <p>We specializes in helping the Vietnam’s foreign community with their long- and short-term real estate rental and purchasing needs, including apartments, houses, villas and commercial office space within Ha Noi proper and the surrounding area.</p>
                       <div id="contact">
                       <div class="contactleft">
                       <?php 
                            echo $this->Form->create('Sendfriend', array(
                                    'inputDefaults' => array(
                                            'div' => 'control-group',
                                            'label' => array(
                                                    'class' => 'control-label'
                                            ),
                                            'wrapInput' => 'controls'
                                    ),
                                    'class' => 'form-horizontal contact'
                            ));
                            echo $this->Form->inputs();
                            echo $this->Form->end('Send');

                        ?>
                       </div>
                       </div>
                    </div>
                    <div class="tab-pane show_map_content" id="settings" style="display:block;visibility:hidden;height: 10px">
                        <a style="display:none;" href="#" class="" id="hotel_address"><?php  echo $ProductVN['product']['address'].', '.$ProductVN['location']['district'].', '.$ProductVN['location']['city']; ?>, Việt Nam</a>
                        <div class="aside">
                                <div class="hotel_mapbox" id="hotel_mapbox" data-latitude="10.775872" data-longitude="106.701287"></div>
                        </div>
                    </div>
                  </div>

            <!--END TAB -->
        </div>
    </div>
    <!-- END PRODUCTS DEFAULT -->
    <?php }else{ ?>
    <!-- BEGIN PRODUCTS APT -->
    <div id="product_view" style="padding-top:0px;">
        <div id="title_fearture" style="border:none; margin: 20px 0px 0px 2px;">
            <span><?php echo $Product['product_language']['name'] ?></span>
        </div>
        <span><b>Property ID</b>: <?php echo $Product['product']['product_id'] ?> (<?php echo __('Please use this ID when calling');?>)</span>
        <p></p>
        
        <div id="content_product" >
            <div id="product_ct_left">
            	<div id="gallery" class="ad-gallery boder_radius">
                      <div class="ad-image-wrapper">
                      </div>
                      <div class="ad-controls">
                      </div>
                      <div class="ad-nav">
                        <div class="ad-thumbs">
                          <ul class="ad-thumb-list">
                            <li>
                              <a href="<?php echo $this->webroot.$base_config_url.$Product['product']['image']?>">
                                <img src="<?php echo $this->webroot.$base_config_url.$Product['product']['image']?>" class="image0">
                              </a>
                            </li>
                           <?php foreach($Product['images'] as $image):?>
                            <li>
                              <a href="<?php echo $this->webroot.$base_config_url.$image['ProductImage']['url']?>">
                                <img src="<?php echo $this->webroot.$base_config_url.$image['ProductImage']['url']?>" class="image0">
                              </a>
                            </li>
                            <?php endforeach;?>
                          </ul>
                        </div>
                      </div>
                 </div>
            </div>
            <div id="product_ct_right" style="height:550px; overflow: auto;">
                <h4>Property Information:</h4>
                <div class="description_product">
                    <p>
                        <?php echo $Product['product_language']['description']; ?>
                    </p>
                </div>
            </div>
            <div class="clearBoth"></div>
        </div>
    </div>
    <!-- END PRODUCTS APT -->
    <?php }?>
	<!----- feature ---->
    <div id="title_fearture">
        <span><?php  echo $Title_property; ?></span>
            
    </div>
    <div id="h_feature" class="" style="margin-bottom:20px;">
        <div class="h_container_list">
        
        <ul class="h_list_product">
            <?php if(is_array($ListProductQuery)){?>
            <?php foreach($ListProductQuery as $value): ?>
                <?php //print_r($value);exit; ?>
				<li>
                    <div class="h_product_image pull-left"  style="position: relative;">
                        <?php if(strtotime(date('Y-m-d', strtotime($value['product']['created'].' + 7 day'))) >= strtotime(date('Y-m-d', time()))){ echo  '<img class="img_new" src="'.$this->webroot.'images/new.gif" />';  }?>
                        <a class="h_product_name" href="<?php echo $this->Html->url('/home/productview/'.$value['product']['product_id']);?>"><img src="<?php echo $this->webroot . URL_PRODUCT_IMAGE . $value['product']['image'] ?>" /></a>
                    </div>
                    <div class="h_product_detail pull-left">
                        <div class="detail_top">
                        <h4>
                            <a class="h_product_name" href="<?php echo $this->Html->url('/home/productview/'.$value['product']['product_id']);?>"><?php echo $value['product_language']['name'] ?></a>
                        </h4>
                        
                        <span class="h_bold"> Price</span> : <span class="h_price">
                        $<?php echo $value['product']['price'] ?> <?php echo $unitprice = $value['product']['unit_price'] == 2 ? '/m2' : '/month'; ?></span><br/>
						<span class="h_bold">Location</span> : <?php echo $value['product']['address'].' / '.$value['address_truelever']['district'].' , '.$value['address_truelever']['city']; ?></br>
                        <?php if(is_array($value['property_value'])){?>
						<?php foreach($value['property_value'] as $property_type=>$val){ ?>
							<?php
								if(!($val['property_language']) || !($val['property_value_language'])) {continue;}
								if(in_array($val['property_id'], Configure::read('Property.hideen'))) {continue;}
								if(in_array($val['property_id'], Configure::read('Property.value_m2'))){ $val['property_value_language'] = $val['property_value_language'].'m2';}
								
							?>
							<span class="h_bold"><?php echo $val['property_language']?></span>  <?php echo $val['property_value_language'].'</br>'; ?>
							
						<?php } }?>
                        </div>
                    </div>
                    <br class="clearBoth" />
                    <p class="p_producttype"><?php echo $value['product_type']['producttype_name'];?></p>
                </li>
            
            <?php endforeach;?>
            <?php }?>
            <div class="clearBoth"></div>

        </div>
    </ul>
            <div class="clearBoth"></div>
    </div>
    <!----- end feature ---->
</div>
<!------------------------------ end body ------------------------------------->

<style type="text/css">
	#price{
		background: url(<?php echo $this->webroot; ?>images/pricebg.png) no-repeat right;
		text-align: right;
		padding-right: 35px;
		font: bold 13px arial;
		color: #fff;
                height:60px;
	}
	#product_ct_left{
		float:left;
		width:58%;
		
	}
	#product_ct_right{
		float:right;
		width:40%;
		
	}
        .ad-gallery .ad-thumbs li a img{
            height:100px;
        }
        .ad-gallery{
            width:520px;
            padding:0px 25px 10px 25px;
            margin-top: 0px;
        }
        #table_property_th{
            text-align: center;
            font-weight: 400;
            background-color: #3498db;
            color: #fff;
            text-transform: uppercase;
        }
</style>
<script>

$(document).ready(function(){
    var galleries = $('.ad-gallery').adGallery();
});
</script>